package org.raymond.icloud.apis.admin.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.raymond.icloud.apis.admin.entity.enums.SexEnum;
import org.raymond.icloud.apis.admin.entity.enums.StateEnum;
import org.raymond.icloud.common.core.mybatis.entity.AbstractEntity;

import javax.validation.constraints.NotEmpty;
import java.util.Date;

@Data
@Builder
@EqualsAndHashCode(onlyExplicitlyIncluded=true, callSuper = false)
@TableName("t_sys_user")
public class TSysUser extends AbstractEntity {
    @ApiModelProperty(name="id", value = "用户Id", dataType="Long")
    @EqualsAndHashCode.Include
    @TableId(value="id", type= IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty(name="username", value = "用户名称", dataType="String")
    @NotEmpty(message = "username不能为空")
    @TableField("username")
    private String username;

    @ApiModelProperty(name="password", value = "密码", dataType="String")
    @NotEmpty(message = "password不能为空")
    @TableField("password")
    private String password;

    @ApiModelProperty(name="email", value = "邮箱", dataType="String")
    @TableField("email")
    private String email;

    @ApiModelProperty(name="mobilePrefix", value = "手机号前缀", dataType="String")
    @TableField("mobile_prefix")
    private String mobilePrefix;

    @ApiModelProperty(name="mobile", value = "手机号", dataType="String")
    @TableField("mobile")
    private String mobile;

    @ApiModelProperty(name="sex", value = "性别, 0-未公开,1-男,2-女", dataType="Integer")
    @TableField("sex")
    private SexEnum sex;

    @ApiModelProperty(name="birthday", value = "生日", dataType="Date")
    @TableField("birthday")
    private Date birthday;

    @ApiModelProperty(name="source", value = "来源", dataType="Integer")
    @TableField("source")
    private Integer source;

    @ApiModelProperty(name="state", value = "状态, 0-停用, 1-正常", dataType="Integer")
    @TableField("state")
    private StateEnum state;
}
